{layout name="daili/layout"}
<main class="app-content">
<div class="row">
        <div class="col-md-6">
          <div class="tile">
            <h3 class="tile-title">长按保存</h3>
               <div>
              <img style="margin:0 auto;" id="ecode" src="http://qr.liantu.com/api.php?text=http://{$_SERVER['HTTP_HOST']}/index.html?daili={:session("dailiUid")}&logo=http://cdn.xqmag.cn//uploads/20180704/f05a2e752150cfbcefb76bd8b7bc0fbd.png">
          </div>
          </div>
        </div>
        <div class="col-md-6">
        <span style="margin-bottom:0.2rem" onclick="copy()" class="badge badge-dark">我的地址(点我复制)</span>
        <input class="form-control form-control-sm"  id="inputSmall" value="" type="text">
      </div></div>
</main>

<script>
function copy(){
  Url2=document.getElementById("inputSmall");
  Url2.select(); // 选择对象
  document.execCommand("Copy");
  alert('复制成功!');
}
$.ajax("http://suo.im/api.php?format=jsonp&url=http://{$_SERVER['HTTP_HOST']}/index.html?daili={:session('dailiUid')}&callback=getuel",{
    dataType: 'jsonp', 
    jsonp: 'callback',
    jsonpCallback:'geturl',
    success:(data)=>{
      console.log(data);
      $("#inputSmall").val(data.url);
    }
})

</script>